//
// Created by xili on 2024/8/26 15:29.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    vector <vector<int>> kClosest(vector <vector<int>> &points, int k) {
        sort(points.begin(), points.end(), [](vector<int> a, vector<int> b) {
            return a[0] * a[0] + a[1] * a[1] < b[0] * b[0] + b[1] * b[1];
        });
        return {points.begin(), points.begin() + k};
    }
};